package com.lds.erp.order.base;

import com.alibaba.dubbo.config.annotation.Reference;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.dph.common.utils.base.BaseController;
import com.dph.common.utils.utils.AppUtils;
import com.lds.erp.base.JsonResult;
import com.lds.erp.base.baseset.SalesSetFacade;
import com.lds.erp.base.baseset.order.SalesSetQueryOrder;
import com.lds.erp.base.baseset.result.SalesSetQueryResult;
import com.lds.erp.common.AppEnum;
import com.lds.erp.common.util.AccountCache;
import com.lds.erp.common.util.AccountUtils;
import com.lds.erp.order.OrderCartClient;
import com.lds.erp.order.base.vo.SalesSetQueryVO;
import com.lds.erp.order.cart.ao.*;
import com.lds.erp.order.cart.order.*;
import com.lds.erp.order.cart.result.*;
import com.lds.erp.order.cart.vo.*;
import com.lds.erp.product.categories.ProductCategoriesFacde;
import com.lds.erp.util.JsonUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author liuli
 */
@RestController
@Api(value = "销售设置", description = "销售设置", tags = {"销售设置接口"})
@RequestMapping(value = "/api/order/base/")
public class BaseSetController extends BaseController {
    @Autowired
    private OrderCartClient orderCartClient;


    @Reference(version = "1.0")
    private SalesSetFacade salesSetFacade;

    @GetMapping(value = "sales_set_query")
    @ApiOperation(value = "销售设置查询", notes = "销售设置查询")
    public JsonResult<SalesSetQueryVO> salesSetQuery() {

        SalesSetQueryOrder order = new SalesSetQueryOrder();
        order.setSerialNo(AppUtils.newNo());
        SalesSetQueryResult result = salesSetFacade.salesSetQuery(order);
        return result.isSuccess() ? JsonUtils.success(result, SalesSetQueryVO.class)
                : JsonUtils.fail(result.getMessage());
    }

}
